package com.dongao.marketing.modules.sys.service.interfac;

import java.util.List;

import com.dongao.marketing.common.persistence.Page;
import com.dongao.marketing.common.security.shiro.session.SessionDAO;
import com.dongao.marketing.modules.sys.entity.Menu;
import com.dongao.marketing.modules.sys.entity.Role;
import com.dongao.marketing.modules.sys.entity.User;

public interface ISystemService {

	public static final String HASH_ALGORITHM = "SHA-1";
	public static final int HASH_INTERATIONS = 1024;
	public User getUser(String id);
	public User getUserByLoginName(String loginName);
	public User getByLoginName(User user);
	public Page<User> findUser(Page<User> page, User user);
	public List<User> findUser(User user);
	public void saveUser(User user);
	public void updateUserInfo(User user);
	public void deleteUser(User user);
	public void updatePasswordById(String id, String loginName, String newPassword);
	public void updateUserLoginInfo(User user);
	public String entryptPassword(String plainPassword);
	public boolean validatePassword(String plainPassword, String password);
	
	public User assignUserToRole(Role role, User user);
	
	public List<Role> findAllRole();
	public List<Role> findAllList(Role role);
	public List<Role> findList(Role role);
	public Role getRole(String id);
	public void saveRole(Role role);
	public void deleteRole(Role role);
	public Boolean outUserInRole(Role role, User user);
	public Role getRoleByName(String name);
	public Role getRoleByEnname(String name);
	
	
	public Menu getMenu(String id);
	public List<Menu> findAllMenu();
	public void saveMenu(Menu menu);
	public void deleteMenu(Menu menu);
	public void updateMenuSort(Menu menu);
	public List<Menu> findAllList(Menu menu);
	public User get(String id);
	public List<Menu> findByUserId(Menu m);
}
